package com.game.shudu;

public class Main {
    public static void main(String[] args) {
        SudokuPuzzleGenerator example = new SudokuPuzzleGenerator();
        for (int i = 1; i <= 3; i++) {
            int[][] grids = example.generatePuzzleMatrix();
            printArray(grids);
            System.out.println();
        }
    }

    /**
     * 打印二维数组到控制台
     */
    private static void printArray(int[][] grids) {
        for (int i = 0; i < 9; i++) {
            if (i % 3 == 0) {
                System.out.println(" -----------------------");
            }
            for (int j = 0; j < 9; j++) {
                if (j % 3 == 0) {
                    System.out.print("| ");
                }
                System.out.print(grids[i][j] == 0 ? " " : grids[i][j]);
                System.out.print(" ");
            }
            System.out.println("|");
        }
        System.out.println(" -----------------------");
    }
}
